package com.grf.function.config;

import com.grf.function.function.CustomizeConsumer;
import com.grf.function.function.CustomizePredicate;
import com.grf.function.function.CustomizeSupplier;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description: 自定义配置
 * @author: grf
 * @date: 2024/9/1
 */
@Slf4j
@Configuration
public class CustomizeConfig {

    @Bean
    public CustomizeSupplier customizeSupplier(){
        return () -> "supplier bean";
    }


    @Bean
    public CustomizeConsumer customizeConsumer() {
        return p -> {
            var ll = "consumer bean " + p;
            log.info("consumer bean: {}", ll);
        };
    }

    @Bean
    public CustomizePredicate customizePredicate(){
        return p -> p.startsWith("param");
    }
}
